/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package seso;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "ETFileQuantity", catalog = "M3ERP", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "ETFileQuantity.findAll", query = "SELECT e FROM ETFileQuantity e"),
    @NamedQuery(name = "ETFileQuantity.findByTransactionNo", query = "SELECT e FROM ETFileQuantity e WHERE e.eTFileQuantityPK.transactionNo = :transactionNo"),
    @NamedQuery(name = "ETFileQuantity.findByFileSequence", query = "SELECT e FROM ETFileQuantity e WHERE e.eTFileQuantityPK.fileSequence = :fileSequence"),
    @NamedQuery(name = "ETFileQuantity.findByQuantity", query = "SELECT e FROM ETFileQuantity e WHERE e.quantity = :quantity"),
    @NamedQuery(name = "ETFileQuantity.findByFileName", query = "SELECT e FROM ETFileQuantity e WHERE e.fileName = :fileName")})
public class ETFileQuantity implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ETFileQuantityPK eTFileQuantityPK;
    @Basic(optional = false)
    @Column(name = "Quantity")
    private int quantity;
    @Basic(optional = false)
    @Column(name = "FileName")
    private String fileName;

    public ETFileQuantity() {
    }

    public ETFileQuantity(ETFileQuantityPK eTFileQuantityPK) {
        this.eTFileQuantityPK = eTFileQuantityPK;
    }

    public ETFileQuantity(ETFileQuantityPK eTFileQuantityPK, int quantity, String fileName) {
        this.eTFileQuantityPK = eTFileQuantityPK;
        this.quantity = quantity;
        this.fileName = fileName;
    }

    public ETFileQuantity(String transactionNo, int fileSequence) {
        this.eTFileQuantityPK = new ETFileQuantityPK(transactionNo, fileSequence);
    }

    public ETFileQuantityPK getETFileQuantityPK() {
        return eTFileQuantityPK;
    }

    public void setETFileQuantityPK(ETFileQuantityPK eTFileQuantityPK) {
        this.eTFileQuantityPK = eTFileQuantityPK;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        int oldQuantity = this.quantity;
        this.quantity = quantity;
        changeSupport.firePropertyChange("quantity", oldQuantity, quantity);
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        String oldFileName = this.fileName;
        this.fileName = fileName;
        changeSupport.firePropertyChange("fileName", oldFileName, fileName);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eTFileQuantityPK != null ? eTFileQuantityPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ETFileQuantity)) {
            return false;
        }
        ETFileQuantity other = (ETFileQuantity) object;
        if ((this.eTFileQuantityPK == null && other.eTFileQuantityPK != null) || (this.eTFileQuantityPK != null && !this.eTFileQuantityPK.equals(other.eTFileQuantityPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "seso.ETFileQuantity[ eTFileQuantityPK=" + eTFileQuantityPK + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
